//
//  HELOrderListVC.m
//  NursingAssociation
//
//  Created by wsj2015 on 2017/3/8.
//  Copyright © 2017年 wsj2015. All rights reserved.
//

#import "HELOrderListVC.h"
#import "HELOrderTableVC.h"
@interface HELOrderListVC ()

@property (nonatomic,  strong) HELOrderTableVC *leftOrderVC;
@property (nonatomic,  strong) HELOrderTableVC *centerOrderVC;
@property (nonatomic,  strong) HELOrderTableVC *rightOrderVC;


@end

@implementation HELOrderListVC


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self addLine];
    
    
}

- (HELOrderTableVC *)leftOrderVC{
    if (!_leftOrderVC) {
        _leftOrderVC = [HELOrderTableVC new];
        _leftOrderVC.orderType = OrderType_unCompelet;
      
    }
    return _leftOrderVC;
}
- (HELOrderTableVC *)centerOrderVC{
    if (!_centerOrderVC) {
        _centerOrderVC = [HELOrderTableVC new];
        _centerOrderVC.orderType = OrderType_compeleted;
        
    }
    return _centerOrderVC;
}
- (HELOrderTableVC *)rightOrderVC{
    if (!_rightOrderVC) {
        _rightOrderVC = [HELOrderTableVC new];
        _rightOrderVC.orderType = OrderType_other;
       
    }
    return _rightOrderVC;
}

- (instancetype)init {
    if (self = [super init]) {
        self.titleSizeNormal = 17;
        self.titleSizeSelected = 17;
        self.menuViewStyle = WMMenuViewStyleLine;
        self.menuItemWidth = [UIScreen mainScreen].bounds.size.width / 3;
        self.menuHeight = 49;
        self.menuView.speedFactor = 3;
        self.title = @"我的订单";
        self.menuBGColor = [UIColor whiteColor];
        self.titleColorSelected =kMainColor;
        self.titleColorNormal =[UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:1.0];
    }
    return self;
}
- (void)addLine{
    UIView *line = [UIView new];
    line.backgroundColor = kBorderColor;
    line.frame = CGRectMake(0, 48, kScreenWidth, 1);
    [self.menuView insertSubview:line atIndex:0];
    
}


#pragma mark - Datasource & Delegate
- (NSInteger)numbersOfChildControllersInPageController:(WMPageController *)pageController {
    return 3;
}

- (UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index {
    if (index == 0) {
        
        return self.centerOrderVC;
    }else if(index ==1){
        return self.leftOrderVC;
    }else{
       return self.rightOrderVC;
    }
    
    
}

- (NSString *)pageController:(WMPageController *)pageController titleAtIndex:(NSInteger)index {
    
    return @[@"已完成",@"未完成",@"其他"][index];
}
- (void)pageController:(WMPageController *)pageController willEnterViewController:(__kindof UIViewController *)viewController withInfo:(NSDictionary *)info{
    
    HELOrderTableVC *vc = viewController;
    [vc requestDataFirst];
    
}

@end
